package com.autonavi.yunda.yunji.core.vo.response;

import com.autonavi.yunda.yunji.core.model.dto.PartUnitDTO;
import lombok.Data;

import java.util.List;
import java.util.stream.Collectors;

@Data
public class PartUnitPageVO {
    private List<PartUnitVO> partUnits;
    private Long total;

    public PartUnitPageVO(List<PartUnitDTO> partUnitDTOList, Long total, String approvalFlowUrl) {
        this.partUnits = partUnitDTOList.stream()
                .map(dto -> PartUnitVO.from(dto, approvalFlowUrl)).collect(Collectors.toList());
        this.total = total;
    }
}
